package com.atguigu.springboot.controller;

import com.atguigu.springboot.entities.Attraction;
import com.atguigu.springboot.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.imageio.spi.RegisterableService;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("register")
public class registerController {

    @Autowired
    RegisterService registerService;
    @ResponseBody
    @GetMapping("/punch")
    public boolean punch(int uid,int aid, HttpSession session){
        uid=(int)session.getAttribute("uid");
        return registerService.register(uid,aid);
    }
}
